In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule) is a method of incorporating new knowledge to update the value of the probability of occurence of an event. To that end the theorem gives the relationship between the updated probability , the conditional probability of given the new knowledge , and the probabilities of and , and , and the conditional probability of given , . The theorem is named for Thomas Bayes (pronounced /ˈbeɪz/ or "bays").[1] In its most common form, Bayes' theorem is:
Contents |
If someone told you he had a nice conversation in the train, the probability it was a woman he spoke with is 50%. If he told you the person he spoke to was going to visit a quilt exhibition, it is far more likely than 50% it is a woman. Call the event he spoke to a woman, and the event "a visitor of the quilt exhibition". Then: , but with the knowledge of the updated value is that may be calculated with Bayes' formula as:
in which (man) is the complement of . As and , the updated value will be quite close to 1.
Bayes' theorem has two distinct interpretations. In the frequentist interpretation it relates two representations of the probabilities assigned to a set of outcomes (conceptual inverses of each other). Both can be meaningful, so if only one is known Bayes' theorem enables conversion. In the Bayesian interpretation, Bayes' theorem is an expression of how degrees of belief should rationally be updated to account for evidence. The application of this view is called Bayesian inference, and is widely applied in fields including science, engineering, medicine and law.[2] The meaning of Bayes' theorem depends on the interpretation of probability ascribed to the terms:
In the frequentist interpretation, probability measures the proportion of trials in which an event (a subset of the possible outcomes) occurs. Consider events and . Suppose we consider only trials in which occurs. The proportion in which also occur is . Conversely, suppose we consider only trials in which occurs. The proportion in which also occur is . Bayes' theorem links these two quantities, with and the overall proportions of trials with and .
The situation may be more fully visualised with tree diagrams, shown to the right. For example, suppose that some members of a population have a risk factor for a medical condition, and some have the condition. The proportion with the condition depends whether those with or without the risk factor are examined. The proportion having the risk factor depends whether those with or without the condition are examined. Bayes' theorem links these two representations.
In the Bayesian (or epistemological) interpretation, probability measures a degree of belief. Bayes' theorem then links the degree of belief in a proposition before and after accounting for evidence. For example, suppose somebody proposes that a biased coin is twice as likely to land heads than tails. Degree of belief in this might initially be 50%. The coin is then flipped a number of times to collect evidence. Belief may rise to 70% if the evidence supports the proposition.
For proposition and evidence ,
For more on the application of Bayes' theorem under the Bayesian interpretation of probability, see Bayesian inference.
For events and , provided that .
In a Bayesian inference step, the probability of evidence is constant for all models . The posterior may then be expressed as proportional to the numerator:
Often, for some partition of the event space , the event space is given or conceptualized in terms of and . It is then useful to eliminate using the law of total probability:
In the special case of a binary partition,
Extensions to Bayes' theorem may be found for three or more events. For example, for three events, two possible tree diagrams branch in the order BCA and ABC. By repeatedly applying the definition of conditional probability:
As previously, the law of total probability may be substituted for unknown marginal probabilities.
Consider a sample space generated by two random variables and . In principle, Bayes' theorem applies to the events and . However, terms become 0 at points where either variable has finite probability density. To remain useful, Bayes' theorem may be formulated in terms of the relevant densities (see Derivation).
If is continuous and is discrete,
If is discrete and is continuous,
If both and are continuous,
A continuous event space is often conceptualized in terms of the numerator terms. It is then useful to eliminate the denominator using the law of total probability. For , this becomes an integral:
Under the Bayesian interpretation of probability, Bayes' rule may be thought of as Bayes' theorem in odds form.
Where
Bayes' theorem may be derived from the definition of conditional probability:
For two continuous random variables and , Bayes' theorem may be analogously derived from the definition of conditional density:
An entomologist spots what might be a rare subspecies of beetle, due to the pattern on its back. In the rare subspecies, 98% have the pattern. In the common subspecies, 5% have the pattern. The rare subspecies accounts for only 0.1% of the population. How likely is the beetle to be rare?
From the extended form of Bayes' theorem,
Suppose a drug test is 99% sensitive and 99% specific. That is, the test will produce 99% true positive and 99% true negative results. Suppose that 0.5% of people are users of the drug. If an individual tests positive, what is the probability they are a user?
Despite the apparent accuracy of the test, if an individual tests positive, it is more likely that they do not use the drug than that they do.
This surprising result arises because the number of non-users is very large compared to the number of users, such that the number of false positives (0.995%) outweighs the number of true positives (0.495%). To use concrete numbers, if 1000 individuals are tested, there are expected to be 995 non-users and 5 users. From the 995 non-users, false positives are expected. From the 5 users, true positives are expected. Out of 15 positive results, only 5, about 33%, are genuine.
Bayes' theorem was named after the Reverend Thomas Bayes (1702–61), who studied how to compute a distribution for the probability parameter of a binomial distribution (in modern terminology). His friend Richard Price edited and presented this work in 1763, after Bayes' death, as An Essay towards solving a Problem in the Doctrine of Chances.[3] The French mathematician Pierre-Simon Laplace reproduced and extended Bayes' results in 1774, apparently quite unaware of Bayes' work.[4] Stephen Stigler suggested in 1983 that Bayes' theorem was discovered by Nicholas Saunderson some time before Bayes.[5] Edwards (1986) disputed that interpretation.[6]
Bayes' preliminary results (Propositions 3, 4, and 5) imply the truth of the theorem that is named for him. Particularly, Proposition 5 gives a simple description of conditional probability:
However, it does not appear that Bayes emphasized or focused on this finding. He presented his work as the solution to a problem:
Bayes gave an example of a man trying to guess the ratio of "blanks" and "prizes" at a lottery. So far the man has watched the lottery draw ten blanks and one prize. Given these data, Bayes showed in detail how to compute the probability that the ratio of blanks to prizes is between 9:1 and 11:1 (the probability is low - about 7.7%). He went on to describe that computation after the man has watched the lottery draw twenty blanks and two prizes, forty blanks and four prizes, and so on. Finally, having drawn 10,000 blanks and 1,000 prizes, the probability reaches about 97%.[3]
Bayes' main result (Proposition 9) is the following in modern terms:
It is unclear whether Bayes was a "Bayesian" in the modern sense. That is, whether he was interested in Bayesian inference, or merely in probability. Proposition 9 seems "Bayesian" in its presentation as a probability about the parameter . However, Bayes stated his question in a manner that suggests a frequentist viewpoint: he supposed that a billiard ball is thrown at random onto a billiard table, and considered further billiard balls that fall above or below the first ball with probabilities and . The algebra is of course identical no matter which view is taken.
Stephen Fienberg describes the evolution from "inverse probability" at the time of Bayes and Laplace, a term still used by Harold Jeffreys (1939), to "Bayesian" in the 1950s.[7] Ironically, Ronald A. Fisher introduced the "Bayesian" label in a derogatory sense.
Richard Price discovered Bayes' essay and its now-famous theorem in Bayes' papers after Bayes' death. He believed that Bayes' Theorem helped prove the existence of God ("the Deity") and wrote the following in his introduction to the essay:
In modern terms this is an instance of the teleological argument.